home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 50
/
Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso
/
Aminet
/
dev
/
misc
/
Progr_Langs_v7.lha
/
Progr_Langs
/
Source
/
exe_timer.asc
next >
Wrap
Text File
|
1999-01-31
|
1KB
|
59 lines
WBStartup
Goto versionskip
version:
Even
Dc.b "$VER: exe_timer 2.0 (31.01.99)",0
Even
versionskip:
If NumPars >= 1
If Par$(1)="?"
PutStr_ "Usage: exe_timer PROGRAM"+Chr$(10)
PutStr_ Chr$(10)
PutStr_ "exe_timer measures the execution time of PROGRAM in ``ticks''"+Chr$(10)
PutStr_ "and its memory loss."+Chr$(10)
PutStr_ Chr$(10)
PutStr_ "Hint: Subtract about 2 ticks from the result which are required"+Chr$(10)
PutStr_ " for loading PROGRAM."+Chr$(10)
Else
n$=""
For t.l=1 To NumPars
n$=n$+Par$(t.l)+" "
Next t
n$=StripTrail$(n$,32)
PutStr_ "exe_timer: Running ``"+n$+"''..."+Chr$(10)
PutStr_ Chr$(10)
f1=FastFree
c1=ChipFree
Delay_ 10
a.l=Ticks
r.l=SystemTagList_ (n$,?tl)
r2.l=IoErr_
b.l=Ticks
Delay_ 10
c.l=b.l-a.l
f2=FastFree
c2=ChipFree
fm=f2-f1
cm=c2-c1
PutStr_ Chr$(10)
If c.l<0
PutStr_ "exe_timer: Timer error - try again"+Chr$(10)
Else
PutStr_ "-> elapsed time: "+UStr$(c.l)+" ticks"+Chr$(10)
PutStr_ "-> result code: "+UStr$(r.l)+Chr$(10)
PutStr_ "-> IoErr() code: "+UStr$(r2.l)+Chr$(10)
PutStr_ "-> memory loss (Chip): "+UStr$(cm)+" bytes"+Chr$(10)
PutStr_ "-> memory loss (Fast): "+UStr$(fm)+" bytes"+Chr$(10)
End If
End If
Else
PutStr_ "exe_timer: Required argument missing"+Chr$(10)
End If
End
tl:
Dc.l 0,0